package com.atguigu.bigdata.scala.mytest.chapter06

object Test_Abstract {

  def main(args: Array[String]): Unit = {
    val a = new a
    println(a.name)
    println(a.name1)
    println(a.name2)
    println(a.name3)
  }

  abstract class A1 {
    def a():Unit
    def b():Unit={println("11")}
    //可变
    var name:String
    var name1:String="name1"
    //不可变
    val name2:String
    val name3:String="name3"
  }

  class a extends A1{
    //scala中子类想要重写父类的完整方法，那么需要使用override关键字声明，否则会出现错误
    def a(): Unit = {}
    override def b(): Unit = {}

    var name: String = "name00000000000"
    //可变完整属性不能被重写
    //var name1: String = "name1"
    val name2: String = "name2222222222"
    //不可变完整属性必须加override
    override val name3: String = "name33333"
  }
}
